package com.fling.abcde.fragment;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import androidx.annotation.Nullable;

import com.fling.abcde.base.BaseFragment;
import com.fling.abcde.databinding.FragmentHome1Binding;

/**
 * @author FengLing
 * Created on 2017-08-24 17:23
 */
public class Home1Fragment extends BaseFragment<FragmentHome1Binding> {
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        thisViewBinding.tv.setOnClickListener(new View.OnClickListener() {
            int i = thisViewBinding.gl.getItemsPerRow();

            @Override
            public void onClick(View v) {
                i = ++i % (thisViewBinding.gl.getChildCount());
                thisViewBinding.tv.setText("Item: " + i);
                thisViewBinding.gl.setItemsPerRow(i);
            }
        });
    }
}